<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:WinRTXamlToolkit.Controls">
    <ResourceDictionary.ThemeDictionaries>
        <ResourceDictionary
            x:Key="Default">
            <SolidColorBrush
                x:Key="ToolStripBackground"
                Color="#FF2C2C2C" />
            <SolidColorBrush
                x:Key="ToolBarButtonBackground"
                Color="#FF444444" />
            <SolidColorBrush
                x:Key="FocusRectangleBrush"
                Color="White" />
        </ResourceDictionary>
        <ResourceDictionary
            x:Key="Light">
            <SolidColorBrush
                x:Key="ToolStripBackground"
                Color="#FFD3D3D3" />
            <SolidColorBrush
                x:Key="ToolBarButtonBackground"
                Color="#FFBBBBBB" />
            <SolidColorBrush
                x:Key="FocusRectangleBrush"
                Color="Black" />
        </ResourceDictionary>
    </ResourceDictionary.ThemeDictionaries>

    <Style
        TargetType="local:ToolStrip">
        <Setter
            Property="IsTabStop"
            Value="False" />
        <Setter
            Property="Background"
            Value="{ThemeResource ToolStripBackground}" />
        <Setter
            Property="HorizontalAlignment"
            Value="Stretch" />
        <Setter
            Property="VerticalAlignment"
            Value="Top" />
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="local:ToolStrip">
                    <Grid
                        x:Name="BarGrid"
                        Background="{TemplateBinding Background}">
                        <StackPanel
                            x:Name="BarPanel"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Orientation="Horizontal">
                            <local:ToolBarButton
                                x:Name="DropDownButton"
                                IsTabStop="False"
                                Content="&#xE0A1;"
                                FontFamily="Segoe UI Symbol" />
                        </StackPanel>
                        <Popup
                            x:Name="DropDownPopup"
                            IsLightDismissEnabled="True"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top">
                            <StackPanel
                                x:Name="DropDownPanel"
                                Background="{TemplateBinding Background}">
                            </StackPanel>
                        </Popup>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        TargetType="local:ToolBarButton">
        <Setter
            Property="Height"
            Value="32" />
        <Setter
            Property="Background"
            Value="{ThemeResource ToolBarButtonBackground}" />
        <Setter
            Property="Foreground"
            Value="{ThemeResource ButtonForegroundThemeBrush}" />
        <Setter
            Property="Padding"
            Value="10,6" />
        <Setter
            Property="HorizontalAlignment"
            Value="Stretch" />
        <Setter
            Property="VerticalAlignment"
            Value="Center" />
        <Setter
            Property="HorizontalContentAlignment"
            Value="Left" />
        <Setter
            Property="VerticalContentAlignment"
            Value="Center" />
        <Setter
            Property="FontFamily"
            Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter
            Property="FontWeight"
            Value="Light" />
        <Setter
            Property="FontSize"
            Value="12" />
        <Setter
            Property="BorderThickness"
            Value="0" />
        <Setter
            Property="BorderBrush"
            Value="{x:Null}" />
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="local:ToolBarButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup
                                x:Name="CommonStates">
                                <VisualState
                                    x:Name="Normal" />
                                <VisualState
                                    x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="IconPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="IconPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="IconPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="FocusStates">
                                <VisualState
                                    x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="OuterGrid">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Unfocused" />
                                <VisualState
                                    x:Name="PointerFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="LocationStates">
                                <VisualState
                                    x:Name="PlacedInBar">
                                    <Storyboard />
                                </VisualState>
                                <VisualState
                                    x:Name="PlacedInDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="(UIElement.Visibility)"
                                            Storyboard.TargetName="IconPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="(UIElement.Visibility)"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border
                            x:Name="Border"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}">
                            <Grid
                                x:Name="OuterGrid">
                                <Grid
                                    x:Name="InnerGrid"
                                    Margin="{TemplateBinding Padding}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition
                                            Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition
                                            Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <ContentControl
                                        x:Name="IconPresenter"
                                        Width="30"
                                        AutomationProperties.AccessibilityView="Raw"
                                        IsTabStop="False"
                                        Content="{TemplateBinding Icon}"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        FontSize="10.667"
                                        Foreground="{TemplateBinding Foreground}"
                                        Margin="0,0,6,0"
                                        Visibility="Collapsed"
                                        FontWeight="{TemplateBinding FontWeight}" />
                                    <ContentPresenter
                                        x:Name="ContentPresenter"
                                        Grid.Column="1"
                                        AutomationProperties.AccessibilityView="Raw"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        ContentTransitions="{TemplateBinding ContentTransitions}"
                                        Content="{TemplateBinding Content}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        FontWeight="{TemplateBinding FontWeight}" />
                                    <TextBlock
                                        x:Name="KeyAccessTextBlock"
                                        Grid.Column="2"
                                        TextWrapping="Wrap"
                                        VerticalAlignment="Center"
                                        FontFamily="Segoe UI"
                                        Visibility="Collapsed"
                                        Text="{TemplateBinding Shortcut}"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Margin="20,0,0,0" />
                                </Grid>
                            </Grid>
                        </Border>
                        <!--<Rectangle
                            x:Name="FocusVisual"
                            IsHitTestVisible="False"
                            Opacity="0"
                            StrokeEndLineCap="Square"
                            Stroke="{ThemeResource FocusRectangleBrush}" />-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        TargetType="local:ToolBarToggleButton">
        <Setter
            Property="Height"
            Value="32" />
        <Setter
            Property="Background"
            Value="{ThemeResource ToolBarButtonBackground}" />
        <Setter
            Property="Foreground"
            Value="{ThemeResource ButtonForegroundThemeBrush}" />
        <Setter
            Property="Padding"
            Value="10,6" />
        <Setter
            Property="HorizontalAlignment"
            Value="Stretch" />
        <Setter
            Property="VerticalAlignment"
            Value="Center" />
        <Setter
            Property="HorizontalContentAlignment"
            Value="Left" />
        <Setter
            Property="VerticalContentAlignment"
            Value="Center" />
        <Setter
            Property="FontFamily"
            Value="{ThemeResource ContentControlThemeFontFamily}" />
        <Setter
            Property="FontWeight"
            Value="Light" />
        <Setter
            Property="FontSize"
            Value="12" />
        <Setter
            Property="BorderThickness"
            Value="0" />
        <Setter
            Property="BorderBrush"
            Value="{x:Null}" />
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="local:ToolBarToggleButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup
                                x:Name="CommonStates">
                                <VisualState
                                    x:Name="Normal" />
                                <VisualState
                                    x:Name="PointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Pressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Checked">
                                    <Storyboard>
                                        <DoubleAnimation
                                            Duration="0"
                                            To="1"
                                            Storyboard.TargetProperty="(UIElement.Opacity)"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="CheckedPointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                            Duration="0"
                                            To="1"
                                            Storyboard.TargetProperty="(UIElement.Opacity)"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="CheckedPressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                            Duration="0"
                                            To="1"
                                            Storyboard.TargetProperty="(UIElement.Opacity)"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="CheckedDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimation
                                            Duration="0"
                                            To="1"
                                            Storyboard.TargetProperty="(UIElement.Opacity)"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Indeterminate" />
                                <VisualState
                                    x:Name="IndeterminatePointerOver">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="IndeterminatePressed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPressedForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="IndeterminateDisabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="Border">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="ContentPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Foreground"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonDisabledForegroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="FocusStates">
                                <VisualState
                                    x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="Background"
                                            Storyboard.TargetName="OuterGrid">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0"
                                                Value="{ThemeResource ButtonPointerOverBackgroundThemeBrush}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState
                                    x:Name="Unfocused" />
                                <VisualState
                                    x:Name="PointerFocused" />
                            </VisualStateGroup>
                            <VisualStateGroup
                                x:Name="LocationStates">
                                <VisualState
                                    x:Name="PlacedInBar">
                                    <Storyboard />
                                </VisualState>
                                <VisualState
                                    x:Name="PlacedInDropDown">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="(UIElement.Visibility)"
                                            Storyboard.TargetName="CheckBoxGlyphPresenter">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames
                                            Storyboard.TargetProperty="(UIElement.Visibility)"
                                            Storyboard.TargetName="KeyAccessTextBlock">
                                            <DiscreteObjectKeyFrame
                                                KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border
                            x:Name="Border"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Background="{TemplateBinding Background}">
                            <Grid
                                x:Name="OuterGrid">
                                <Grid
                                    x:Name="InnerGrid"
                                    Margin="{TemplateBinding Padding}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition
                                            Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition
                                            Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock
                                        x:Name="CheckBoxGlyphPresenter"
                                        Width="30"
                                        TextWrapping="Wrap"
                                        Text="&#xE001;"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Foreground="{TemplateBinding Foreground}"
                                        FontFamily="Segoe UI Symbol"
                                        FontSize="10.667"
                                        Margin="0,0,6,0"
                                        Visibility="Collapsed"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Opacity="0" />
                                    <ContentPresenter
                                        x:Name="ContentPresenter"
                                        Grid.Column="1"
                                        AutomationProperties.AccessibilityView="Raw"
                                        ContentTemplate="{TemplateBinding ContentTemplate}"
                                        ContentTransitions="{TemplateBinding ContentTransitions}"
                                        Content="{TemplateBinding Content}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        FontWeight="{TemplateBinding FontWeight}" />
                                    <TextBlock
                                        x:Name="KeyAccessTextBlock"
                                        Grid.Column="2"
                                        TextWrapping="Wrap"
                                        VerticalAlignment="Center"
                                        FontFamily="Segoe UI"
                                        Visibility="Collapsed"
                                        Text="{TemplateBinding Shortcut}"
                                        FontWeight="{TemplateBinding FontWeight}"
                                        Margin="20,0,0,0" />
                                </Grid>
                            </Grid>
                        </Border>
                        <!--<Rectangle
                            x:Name="FocusVisual"
                            IsHitTestVisible="False"
                            Opacity="0"
                            StrokeEndLineCap="Square"
                            Stroke="{ThemeResource FocusRectangleBrush}" />-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
